import request from '@/utils/request'

// 查询资产台账管理列表
export function listAssetInfo(query) {
  return request({
    url: '/business/assetInfo/list',
    method: 'get',
    params: query
  })
}

// 查询资产台账管理详细
export function getAssetInfo(assetId) {
  return request({
    url: '/business/assetInfo/' + assetId,
    method: 'get'
  })
}

// 新增资产台账管理
// export function addAssetInfo(data) {
//   return request({
//     url: '/business/assetInfo',
//     method: 'post',
//     data: data
//   })
// }
export function addAssetInfo(data) {
  return request({
    url: '/business/assetInfo/checkAndInsertAssetInfo',
    method: 'post',
    data: data
  })
}

// 复制资产台账管理
export function copyAssetInfo(data) {
  return request({
    url: '/business/assetInfo/copyAssetInfo',
    method: 'post',
    data: data
  })
}

// 修改资产台账管理
export function updateAssetInfo(data) {
  return request({
    url: '/business/assetInfo',
    method: 'put',
    data: data
  })
}

// 删除资产台账管理
export function delAssetInfo(assetId) {
  return request({
    url: '/business/assetInfo/' + assetId,
    method: 'delete'
  })
}

// 获取不分页列表
export function getAssetInfoList() {
  return request({
    url: 'business/assetInfo/selectcAssetInfoList',
    method: 'get'
  })
}

// 获取资产基本信息
export function getAssetInfoBaseInfo(assetId) {
  return request({
    url: 'business/assetInfo/selectAssetInfo/' + assetId,
    method: 'get'
  })
}

// 历史租赁信息
export function getAssetInfoHistoryLeaseInfo(assetId) {
  return request({
    url: 'business/assetInfo/selectAssetHistoryLeaseInfo/' + assetId,
    method: 'get'
  })
}

// 资产在租信息
export function getAssetInfoLeaseInfo(assetId) {
  return request({
    url: 'business/assetInfo/selectAssetLeaseInfo/' + assetId,
    method: 'get'
  })
}
